#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/07/16 17:02
# @File           : views.py
# @IDE            : PyCharm
# @desc           : 用户鉴权相关接口
from fastapi import APIRouter, Depends

from utils.response import SuccessResponse
from apps.base.auth.validate import Auth, AllUserAuth, User

app = APIRouter()


###########################################################
#    用户管理
###########################################################
@app.get("/user/info", summary="获取当前用户信息")
async def get_user_current_info(auth: Auth = Depends(AllUserAuth())):
    result = User.model_validate(auth.user).model_dump()
    return SuccessResponse(result)
